<script setup>
import { useRouter } from 'vue-router';
import { ref } from 'vue'
const router=useRouter()
const activeMenu = ref('my')
const handleSelect = (k) => {
  activeMenu.value = k
  router.push(`${k}`)
}
</script>
<template>
  <div class="member">
    <el-row>
      <!-- 左边列表 -->
      <el-col :span="6" class="left">
        <el-menu :default-active="$route.path" @select="handleSelect">
          <el-sub-menu index="1">
            <template #title>
              <el-icon><Avatar /></el-icon>
              <span>我的账户</span>
            </template>
            <el-menu-item index="/my" @click="$router.push('/my')"
              >个人中心</el-menu-item
            >
          </el-sub-menu>
          <el-sub-menu index="2">
            <template #title>
              <el-icon><Menu /></el-icon>
              <span>订单管理</span>
            </template>
            <el-menu-item index="/list" @click="$router.push('/list')"
              >我的订单</el-menu-item
            >
          </el-sub-menu>
        </el-menu>
      </el-col>
      <!-- 右边 -->
      <el-col :span="18" class="right">
        <!-- 第一行 -->
        <RouterView
      /></el-col>
    </el-row>
  </div>
</template>
<style lang="scss" scoped></style>
